package com.ktjy.ktmall.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ktjy.common.annotation.Excel;
import com.ktjy.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.math.BigDecimal;

/**
 * sku对象 t_sku_info
 *
 * @author ktjy
 * @date 2025-01-15
 */
@Data
@TableName("t_sku_info")
public class SkuInfo extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * sku编号
     */
    @Excel(name = "sku编号")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 商品名称
     */
    @Excel(name = "商品名称")
    @TableField(value = "goods_id")
    private Long goodsId;

    /**
     * sku编码
     */
    @Excel(name = "sku编码")
    @TableField(value = "stock_sku")
    private String stockSku;

    /**
     * 当前价格
     */
    @Excel(name = "当前价格")
    @TableField(value = "price")
    private BigDecimal price;

    /**
     * 原价
     */
    @Excel(name = "原价")
    @TableField(value = "old_price")
    private BigDecimal oldPrice;

    /**
     * 库存数量
     */
    @Excel(name = "库存数量")
    @TableField(value = "inventory")
    private Long inventory;

    /**
     * 商品图片
     */
    @Excel(name = "商品图片")
    @TableField(value = "picture")
    private String picture;

    /**
     * 状态
     */
    @Excel(name = "状态")
    @TableField(value = "status")
    private Long status;

    /**
     * 商品信息
     */
    @TableField(exist = false)
    private  GoodsInfo goodsInfo;


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("goodsId", getGoodsId())
                .append("stockSku", getStockSku())
                .append("price", getPrice())
                .append("oldPrice", getOldPrice())
                .append("inventory", getInventory())
                .append("picture", getPicture())
                .append("status", getStatus())
                .append("createTime", getCreateTime())
                .append("updateTime", getUpdateTime())
                .append("createBy", getCreateBy())
                .append("updateBy", getUpdateBy())
                .append("remark", getRemark())
                .toString();
    }
}